package pandabay2.service;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionManager {
	static Connection conn;

	public static Connection getConnection() {
		try {
//			String url = "jdbc:mysql://a0851656.mysql.univie.ac.at";
//			String dbName ="a0851656";
//			String uname = "a0851656";
//			String pwd = "panda";
			String url = "jdbc:mysql://a1106868.mysql.univie.ac.at";
			String dbName ="/a1106868";
			String uname = "a1106868";
			String pwd = "panda!";
//			String url = "jdbc:mysql://127.0.0.1:3306";
//			String dbName ="/wbruec";
//			String uname = "root";
//			String pwd = "";

			Class.forName("com.mysql.jdbc.Driver");
			try {
				conn = DriverManager.getConnection(url+dbName,uname,pwd);
			}
			catch (SQLException ex) {
				ex.printStackTrace();
			}
		}
		catch(ClassNotFoundException e) {
			System.out.println(e);
		}
		return conn;
	}

}